"use strict";

const Service = require("egg").Service;

class TableService extends Service {
  async getTableList() {
    const res = await this.app.mysql.select("list");// 查询表
    // await this.app.mysql.get('list',{title: '木头六'});// 查询单条
    // await this.app.mysql.insert('list', { id:4,age:45,name: '王老七' });//增加
    // await this.app.mysql.delete('list', { id: 4 });//删除

    // const option = {
    //   where: {
    //     age: 25,
    //   },
    // };
    // await this.app.mysql.update('list', { name: '木头六', age: 11 }, option); //修改数据并且更新

    return res;
  }
}

module.exports = TableService;
